import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon

class Ico(QWidget):
    
    def __init__(self):
        super().__init__()
        self.initUI()
        
    def initUI(self):
        self.setGeometry(350, 350, 250, 250)
        self.setWindowTitle('TitleWithIcon')
        self.setWindowIcon(QIcon('Title.ico'))
        self.show()
        
if __name__ == '__main__':
    app = QApplication(sys.argv)
    ico = Ico()
    sys.exit(app.exec_())
    